Using Control Property Substitution with System Phrases

To set System Phrase parameters involving control property substitution, enter the parameter strings in the fields manually or click the Control List button to show the Controls List dialog.

Control names and properties can be dragged into any field that accepts a control name and property. The % ..% signs are automatically added. If a control name is used by itself, the value of the control's default property is used. The actual value of the property is substituted for the control name in the parameter string at run time.

For example, to create a greeting that vocalizes digits entered in a previous GetDigits control:
  1. From the System Phrase page, select Digits<>.

  2. To use control property substitution, click to display the Controls List dialog.

  3. Select GetDigits1 from the list of controls.

  4. Select Digits from the Property list.

  5. Drag the Digits property to the parameter field on the System Phrase page.

  6. Click Add Phrase to add the phrase to the Greeting list.

This greeting now automatically vocalizes the digits collected by the GetDigits1 control.

For example, let assume MainMenu is a GetDigits control and the call on a certain channel exited the control after collecting the digits "45"; %MainMenu.Digits% in a phrase would be replaced with "45" before the greeting is played .

In order to play the collected digits we need a PlayGreeting control with an EntryGreeting set at design time to use a Digits System Phrase with the data set to %MainMenu.Digits%.

Or, if not set at design time, this could be done at runtime but before starting the voice system:

Examples

VB

'...
'Form Load Event

Dim greet As Greeting
greet = playGreeting1.greeting
Dim phrs As VBVoiceLib.Phrase
phrs.PhrsType = vbvPhraseTypeConstants.vbvSYSPHRASE
phrs.Type = vbvSysPhraseConstants.vbvDigits
phrs.PhraseData1 = "%MainMenu.Digits%"
entryGreet.InsertPhrase(0, phrs)

VB.NET

import Pronexus.VBVoice
'...
'Form Load Event

Dim greet As Greeting
greet = playGreeting1.greeting
Dim phrs As VBVoiceLib.Phrase
phrs.PhrsType = vbvPhraseTypeConstants.vbvSYSPHRASE
phrs.Type = vbvSysPhraseConstants.vbvDigits
phrs.PhraseData1 = "%MainMenu.Digits%"
entryGreet.InsertPhrase(0, phrs)

C#

using Pronexus.VBVoice;
//...
//Form Load Event

Phrase newPhrase = new Phrase();
newPhrase.PhrsType = vbvPhraseTypeConstants.vbvSYSPHRASE;
newPhrase.Type = vbvSysPhraseConstants.vbvDigits;
newPhrase.PhraseData1 = "%MainMenu.Digits%";
Greeting entryGreet = playGreeting1.EntryGreeting as Greeting;
entryGreet.InsertPhrase(0, newPhrase);

This greeting now automatically vocalizes the digits collected by the GetDigits control.